package com.landiao.ctrler.management;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import com.landiao.common.factory.ResultMsgFactory;
import com.landiao.common.utils.CodecUtils;
import com.landiao.ctrler.BaseCRUDCtrler;
import com.landiao.entities.ShopGrade;
import com.landiao.entities.Vip;
import com.landiao.service.ShopGradeService;

@Controller
@RequestMapping("/management/shopGrade")
public class ShopGradeCtrler extends BaseCRUDCtrler<ShopGrade, String>  {
	private ShopGradeService getShopService() {
        return (ShopGradeService) baseService;
    }
	@Override
	public String save(ShopGrade t, RedirectAttributes redirectAttr) {
		// TODO Auto-generated method stub
		t.setCompId(this.getClientUser().getUser().getCompId());
		t.setShopGradeId(CodecUtils.getUUID());
		baseService.save(t);
		redirectAttr.addFlashAttribute("resultMsg",
				ResultMsgFactory.success("添加成功"));
		return redirectToUrl(viewName("index"));
	}
}
